﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x020002E7 RID: 743
	public class TGroupBy : TParseTreeNode
	{
		// Token: 0x06001A1A RID: 6682 RVA: 0x0032D7B9 File Offset: 0x0032B9B9
		public void setHAVING(TSourceToken st)
		{
			this.havingToken = st;
		}

		// Token: 0x06001A1B RID: 6683 RVA: 0x0032D7C2 File Offset: 0x0032B9C2
		public void setBY(TSourceToken st)
		{
			this.byToken = st;
		}

		// Token: 0x06001A1C RID: 6684 RVA: 0x0032D7CB File Offset: 0x0032B9CB
		public void setGROUP(TSourceToken st)
		{
			this.groupToken = st;
		}

		// Token: 0x170005D1 RID: 1489
		// (get) Token: 0x06001A1E RID: 6686 RVA: 0x0032D7DD File Offset: 0x0032B9DD
		// (set) Token: 0x06001A1D RID: 6685 RVA: 0x0032D7D4 File Offset: 0x0032B9D4
		public virtual bool RollupModifier
		{
			get
			{
				return this.rollupModifier;
			}
			set
			{
				this.rollupModifier = value;
			}
		}

		// Token: 0x170005D2 RID: 1490
		// (get) Token: 0x06001A20 RID: 6688 RVA: 0x0032D7EE File Offset: 0x0032B9EE
		// (set) Token: 0x06001A1F RID: 6687 RVA: 0x0032D7E5 File Offset: 0x0032B9E5
		public virtual TSourceToken BY
		{
			get
			{
				return this.byToken;
			}
			set
			{
				this.byToken = value;
			}
		}

		// Token: 0x170005D3 RID: 1491
		// (get) Token: 0x06001A22 RID: 6690 RVA: 0x0032D7FF File Offset: 0x0032B9FF
		// (set) Token: 0x06001A21 RID: 6689 RVA: 0x0032D7F6 File Offset: 0x0032B9F6
		public virtual TSourceToken GROUP
		{
			get
			{
				return this.groupToken;
			}
			set
			{
				this.groupToken = value;
			}
		}

		// Token: 0x170005D4 RID: 1492
		// (get) Token: 0x06001A24 RID: 6692 RVA: 0x0032D810 File Offset: 0x0032BA10
		// (set) Token: 0x06001A23 RID: 6691 RVA: 0x0032D807 File Offset: 0x0032BA07
		public virtual TSourceToken HAVING
		{
			get
			{
				return this.havingToken;
			}
			set
			{
				this.havingToken = value;
			}
		}

		// Token: 0x170005D5 RID: 1493
		// (get) Token: 0x06001A25 RID: 6693 RVA: 0x0032D818 File Offset: 0x0032BA18
		// (set) Token: 0x06001A26 RID: 6694 RVA: 0x0032D820 File Offset: 0x0032BA20
		public virtual TExpression HavingClause
		{
			get
			{
				return this.havingClause;
			}
			set
			{
				this.havingClause = value;
			}
		}

		// Token: 0x170005D6 RID: 1494
		// (get) Token: 0x06001A27 RID: 6695 RVA: 0x0032D829 File Offset: 0x0032BA29
		// (set) Token: 0x06001A28 RID: 6696 RVA: 0x0032D844 File Offset: 0x0032BA44
		public virtual TGroupByItemList Items
		{
			get
			{
				if (this.items == null)
				{
					this.items = new TGroupByItemList();
				}
				return this.items;
			}
			set
			{
				this.items = value;
			}
		}

		// Token: 0x06001A29 RID: 6697 RVA: 0x0032D850 File Offset: 0x0032BA50
		public override void init(object arg1, object arg2)
		{
			if (arg1 != null)
			{
				if (arg1 is TGroupByItemList)
				{
					this.items = (TGroupByItemList)arg1;
				}
				else if (arg1 is TExpressionList)
				{
					this.items = new TGroupByItemList();
					TExpressionList texpressionList = (TExpressionList)arg1;
					for (int i = 0; i < texpressionList.size(); i++)
					{
						TGroupByItem tgroupByItem = new TGroupByItem();
						tgroupByItem.Expr = texpressionList.getExpression(i);
						tgroupByItem.startToken = texpressionList.getExpression(i).startToken;
						tgroupByItem.endToken = texpressionList.getExpression(i).endToken;
						this.items.addGroupByItem(tgroupByItem);
					}
				}
			}
			if (arg2 != null)
			{
				this.havingClause = (TExpression)arg2;
			}
		}

		// Token: 0x06001A2A RID: 6698 RVA: 0x0032D8F6 File Offset: 0x0032BAF6
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			if (this.items != null)
			{
				this.items.doParse(psql, plocation);
			}
			if (this.havingClause != null)
			{
				this.havingClause.doParse(psql, ESqlClause.having);
			}
		}

		// Token: 0x06001A2B RID: 6699 RVA: 0x0032D922 File Offset: 0x0032BB22
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001A2C RID: 6700 RVA: 0x0032D932 File Offset: 0x0032BB32
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.Items != null)
			{
				this.Items.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x0400198B RID: 6539
		private TGroupByItemList items;

		// Token: 0x0400198C RID: 6540
		private TExpression havingClause;

		// Token: 0x0400198D RID: 6541
		private TSourceToken groupToken;

		// Token: 0x0400198E RID: 6542
		private TSourceToken byToken;

		// Token: 0x0400198F RID: 6543
		private bool rollupModifier;

		// Token: 0x04001990 RID: 6544
		private TSourceToken havingToken;
	}
}
